package ro.gateway.aida.obj;

/**
 * <p>Title: Romanian AIDA</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (comparator) 2003</p>
 * <p>Company: ro-gateway</p>
 * @author Mihai Popoaei, mihai_popoaei@yahoo.com, smike@intellisource.ro
 * @version 1.0-* @version $Id: ActivityRelation.java,v 1.1 2004/10/24 23:37:10 mihaipostelnicu Exp $
 */
public class ActivityRelation
{
      private long activity_id = -1;
      private long relto_activity_id = -1;
      private String relation;
      private GenericActivityProperty relToTitle;

      public GenericActivityProperty getRelToTitle()
      {
            return relToTitle;
      }

      public void setRelToTitle( GenericActivityProperty relToTitle )
      {
            this.relToTitle = relToTitle;
      }

      public String getRelation()
      {
            return relation;
      }

      public long getRelto_activity_id()
      {
            return relto_activity_id;
      }

      public long getActivity_id()
      {
            return activity_id;
      }

      public void setRelation( String relation )
      {
            this.relation = relation;
      }

      public void setRelto_activity_id( long relto_activity_id )
      {
            this.relto_activity_id = relto_activity_id;
      }

      public void setActivity_id( long activity_id )
      {
            this.activity_id = activity_id;
      }

      // STATIC STUFF

      private static String[] relation_labels = new String[]{
            "Select",
            "is part of this activity",
            "is parent for this activity",
            "continued this activity",
            "was continued by this activity"
      };

      private static String[] relation_codes = new String[]{
            "", "parent_of", "child_of", "before", "after"
      };

      public static final String[] getRelationLabels()
      {
            return relation_labels;
      }

      public static final String[] getRelationCodes()
      {
            return relation_codes;
      }

      /**
       * va fi deprecated... multilanguage :D
       * @return
       */
      public static final String getRelationLabel( String relation_code )
      {
            int i = 0;
            for ( ; i < relation_codes.length; i++ )
            {
                  if ( relation_codes[ i ].equals( relation_code ) ) break;
            }
            if ( i < relation_labels.length ) return relation_labels[ i ];
            return "unknown";
      }
      
      public static final String SELECTED="SelectedActivityRelation";
}
